package Globle;

public class Global {

	//发送的消息ID
	public static final  int REQUESTSCREN = 0x10;
	public static final  int REQUESTDRIVERINFO = 0x01;
	public static final  int REQUESTDIRINFO       = 0x02;
	
	
	//接收到的消息ID
	public static final int RECVDIRINFO  = 0x103;
	public static final int RECVDRIVERINFO = 0x101;
	public static final int RECVSCRRN    = 0x100;
	
	public static int  getMsgId(byte a[] )
	{
		int id = 0;
		id = (a[0]&0xff);
		id = id |((a[1]<<8)&0x0000ff00);
		id = id |((a[2]<<16)&0x00ff0000);
		id = id |((a[3]<<24)&0xff000000);
		return id;
	}
	
	public static byte[] setMsgId(int num){
		
		byte a [] = new byte[4];
		a[0] = (byte)(num&0xff);
		a[1] = (byte)((num>>8)&0xff);
		a[2] = (byte)((num>>16)&0xff);
		a[3] = (byte)((num>>24)&0xff);
		return a;
	}
}
